import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {svgBuilder} from './src/plugins/svgBuilder';
import {networkConfig} from './src/config/networkConfig'
import cesium from 'vite-plugin-cesium';


// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue(), cesium(), svgBuilder('./src/assets/icons/svg/')],
    server: {
        host: '0.0.0.0',
        port: 3000,
        fs: {
            strict: false
        },
        proxy: {
            '/rtmpserver': {
                target: networkConfig.serverUrl + '/xiaozhen-rtmpserver/',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/rtmpserver/, '')
            },
            '/ts': {
                target: networkConfig.serverUrl + '/xiaozhen-rtmpserver/ts',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/ts/, '')
            },
            '/devApi': {
                target: networkConfig.serverUrl,
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/devApi/, '')
            },
        }
    }
})
